<template>
  <div class="multi-page-v1">
    <div class="head-con">
      <div class="head-left">
        <h3>视频选集</h3>
        <span class="cur-page">({{detailList.index}}/{{detailList.videoItems.length}})</span>
        <div class="range-box">
          <span v-if="intercut" @click="intercut = !intercut" class="range-box-icon iconfont icon-s-grid"></span>
          <span v-if="!intercut" @click="intercut = !intercut" class="range-box-icon iconfont icon-liebiao"></span>
        </div>
      </div>
      <div class="head-right">
        <span class="next-button">
          <span class="txt">自动连播</span>
          <span class="switch-button">
            <el-switch v-model="switchValue" size="small"/>
          </span>
        </span>
      </div>
    </div>
    <div class="cur-list small-mode">
      <ul v-if="intercut" class="list-box">
        <li v-for="(item,index) in detailList.videoItems" :key="index" class="onLi">
          <a  @click="changeIndex(index + 1,item.videoId);blueHover = index;" :class="{SectionSelector_active__dySMp:blueHover === index,hover_blue:blueHover != index}"   class="router-link-active" :title="item.title">
            <div class="clickitem">
              <div class="link-content">
                <img src="//s1.hdslb.com/bfs/static/jinkela/video/asserts/playing.gif" style="display: none;">
                <span class="page-num">P{{index + 1}}</span>
                <span class="part">{{ item.title }}</span>
              </div>
              <div class="duration">{{ item.duration }}</div>
            </div>
          </a>
        </li>
      </ul>

      <ul v-if="!intercut" class="block-ul">
        <li class="module-box clearfix" v-for="(item,index) in detailList.videoItems" :key="index">
          <a @click="changeIndex(index + 1,item.videoId);blueHover = index;" :class="{numberListItem_select__WgCVr:blueHover === index,hover_blue:blueHover != index}" :title="item.title" class="module-box-a">
            <span class="span-link">{{index + 1}}</span>
          </a>
        </li>
      </ul>

    </div>
  </div>
</template>

<script>


export default {
  name: "videoEpisode",
  data(){
    return{
      switchValue:'',
      curList:[],
      intercut:true,
      index:1
    }
  },
  created() {
  },
  methods: {
    changeIndex(index,videoId){
      this.switchVideo(videoId)
      this.index = index
    }
  },
  inject: [
    "detailList",
      "switchVideo",
      "curVideoId"
  ]
}
</script>

<style scoped>
/*中部 视频选中样式*/
.SectionSelector_active__dySMp {
  color: #00AEEC;
}
.hover_blue:hover {
  color: #4daae4;
}
/* 盒子样式 视频被选中样式*/
.numberListItem_select__WgCVr {
  background-color: #00a1d6;
  color: #fff;
}
.multi-page-v1{
  font-family: PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif;
  font-weight: 400;
  position: relative;
  z-index: 1;
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 0;
  display: block;
  width:350px;
  height:386px;
  font-size: 12px;
  line-height: 1.5;
  color: #222;
  background-color: #F1F2F3;;
}
.head-con {
  display: flex;
  padding: 14px 16px 0;
  margin-bottom: 5px;
  align-items: center;
  justify-content: space-between;
}
.head-left{
  display: flex;
  align-items: center;
}
.head-left h3 {
  padding: 0;
  font-size: 15px;
  line-height: 20px;
  font-family: PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  margin: 0 5px 0 0;
  color: #18191C;
}
.cur-page{
  color: #9499A0;
  line-height: 16px;
}
.range-box{
  height: 24px;
  color: #9499A0;
}
.range-box-icon {
  cursor: pointer;
  line-height: 24px;
  font-size: 16px;
  margin: 1px 0 0 10px;
  color: #757575;
  display: inline-block;
  font-style: normal;
  vertical-align: baseline;
  text-align: center;
  text-transform: none;
}
.range-box-icon:hover{
  color: #00AEEC;
}
.head-right{

}

.txt {
  color: #9499A0;
  font-size: 14px;
  line-height: 16px;
  margin-right: 5px;
  vertical-align: middle;
}
.cur-list {
  /*overflow: auto;*/
  padding: 4px 0;
  transition: all 0.3s;
  max-height: 340px;
  /*overflow: hidden;*/
  overflow-y: auto;
}
.list-box {
  padding: 0 6px;
  list-style: none;

}
.list-box li {
  width: 338px;
  display: block;
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  margin: 5px 0;
  transition: all 0.3s;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  font-size: 13px;
  box-sizing: border-box;
  text-align: -webkit-match-parent;
}
.onLi:hover{
  background-color: rgb(255,255,255);
}

.router-link-active{
  color: #18191C;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  line-height: inherit;
}
.clickitem{
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  width: 100%;
}
.page-num {
  margin-right: 10px;
}
.duration {
  color: #9499A0;
  justify-self: flex-end;
}
/*-------------------------------*/
.block-ul{
  padding: 0 6px;
  list-style: none;
  margin-top: 8px;
  margin-left: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.clearfix {
  zoom: 1;
}
.module-box {
  width: 70px;
  background: #F1F2F3;
  float: left;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border: 1px solid #E3E5E7;
  border-radius: 4px;
  margin: 0 7px 8px 0;
  transition: all 0.3s;
  font-size: 13px;
}
.module-box:hover{
  border: 1px solid #00AEEC;
}
.module-box-a {
  width: 70px;
  color: #18191C;
  background-color: transparent;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  transition: color .3s;
}

.span-link {
  display: inline-block;
  width: 100%;
  height: 100%;
}
</style>
